/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sadhar.sipp.perekamananggarangaji;

import org.sadhar.sia.common.ClassSession;
import org.sadhar.sia.framework.ClassApplicationModule;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Session;
import org.zkoss.zk.ui.Sessions;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Label;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;

/**
 *
 * @author hendro
 */
public class PerekamanAnggaranGajiWnd extends ClassApplicationModule {

    private Label lblTahunAnggaran;
    private Combobox cmbGajiPegawai;
    private Textbox txtboxUnitKerja;
    private Listbox lstboxKomponen;
    private Label lblTotalAnggaranKomponen;
    private Listbox lstboxAnggaranBiayaGaji;
    private Label lblTotalAnggaranBiayaGaji;
    private Textbox txtboxKodeUnitKerja;
    private ClassSession session;
    private Session sesi;

    public PerekamanAnggaranGajiWnd() {
    }

    public void onCreate() throws Exception {
        lblTahunAnggaran = (Label) getFellow("lblTahunAnggaran");
        cmbGajiPegawai = (Combobox) getFellow("cmbGajiPegawai");
        txtboxUnitKerja = (Textbox) getFellow("txtboxUnitKerja");
        lstboxKomponen = (Listbox) getFellow("lstboxKomponen");
        lblTotalAnggaranKomponen = (Label) getFellow("lblTotalAnggaranKomponen");
        lstboxAnggaranBiayaGaji = (Listbox) getFellow("lstboxAnggaranBiayaGaji");
        txtboxKodeUnitKerja = (Textbox) getFellow("txtboxKodeUnitKerja");
        sesi = Sessions.getCurrent();
        session = (ClassSession) sesi.getAttribute("CURRENT_SESSION");
        lblTahunAnggaran.setValue(session.getThnAnggaran());
    }

    public void btnSimpanOnClick() throws Exception {
    }

    public void btnBatalOnClick() throws Exception {
    }

    public void btnCariUnitKerjaOnClick() throws Exception {
        final Window win = (Window) Executions.createComponents("/sippzul/perekamananggarangaji/UnitKerjaPopup.zul", this, null);
        Textbox txtboxKeySearch = (Textbox) win.getFellow("txtboxKeySearch");
        txtboxKeySearch.setValue(txtboxUnitKerja.getValue());
        win.doModal();
    }
}
